home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
TPUG - Toronto PET Users Group
/
TPUG Users Group CD
/
TPUG Users Group CD.iso
/
C64
/
C-Communications
/
(c)c12b.d64
/
script files
< prev
next >
Wrap
Text File
|
2007-02-04
|
10KB
|
334 lines
3.3 sCRIPT FILES
3.3.1 dESCRIPTION.
sCRIPT FILES ARE USER-CREATED PROGRAMS CONTAINING COMMANDS WHICH
INSTRUCT THE TERMINAL TO PERFORM CERTAIN FUNCTIONS AUTOMATICALLY. yOU
FIRST CREATE A "PROGRAM" USING THE SCRIPT LANGUAGE, AND THEN YOU
COMPILE THE PROGRAM INTO COMMAND CODES WHICH THE TERMINAL INTERPRETS
AND EXECUTES. aN EXAMPLE OF A SCRIPT IS A PROGRAM THAT CALLS UP A
bbs, LOGS IN WITH YOUR NAME AND PASSWORD, READS NEW MESSAGES AND
CAPTURES THEM IN THE BUFFER, LOGS OFF, AND SAVES THE MESSAGES TO DISK.
tO CREATE A SCRIPT, USE THE sEQ EDITOR TO WRITE A FILE WITH THE SCRIPT
COMMANDS, AND THEN RUN THE sCRIPT COMPILER TO CONVERT THE SEQUENTIAL
FILE INTO AN EXECUTABLE SCRIPT FILE. tHE SCRIPT SOURCE CODE MAY BE
SAVED EITHER IN A SEQUENTIAL FILE OR AS LINES IN A PROGRAM WITH LINE
NUMBERS. eACH COMMAND SHOULD BE ENTERED ON A SEPARATE LINE; NO COLONS
OR OTHER CHARACTERS ARE USED TO SEPARATE COMMANDS ON THE SAME LINE.
yOU MAY INCLUDE COMMENTS IN THE SCRIPT PROGRAM BY PLACING THE COMMENT
TEXT AFTER A SEMICOLON (";") ON A LINE. tHE COMPILER IGNORES ANYTHING
ON A LINE THAT COMES AFTER A SEMICOLON.
3.3.2 sCRIPT COMMANDS.
cOMMANDS ARE GIVEN IN UPPERCASE. hOWEVER, THE ACTUAL SCRIPT PROGRAMS
SHOULD HAVE LOWERCASE COMMANDS!
aNY ARGUMENTS THAT GO ALONG WITH THE COMMANDS ARE PLACED NEXT TO THEM.
nUMERIC ARGUMENTS ARE IN BRACKETS [ ], AND STRING ARGUMENTS ARE IN
QUOTES " ". oPTIONAL ARGUMENTS ARE GIVEN INSIDE GREATER-THAN AND
LESS-THAN SYMBOLS. tHE DESCRIPTION OF THE ARGUMENT IS IN LOWERCASE.
fOR COMMANDS THAT LOAD MODULE FILES, OMIT THE PREFIX FROM THE FILE
NAME. (fOR EXAMPLE, prot"xmodem" WOULD WORK, BUT prot"prt.xmodem"
WOULD NOT.)
asc "ASCII TABLE"
lOADS THE ascii TRANSLATION TABLE WITH THE GIVEN FILE NAME.
baud [BAUD RATE]
cHANGES THE BAUD RATE TO THE SPECIFIED NUMBER. iF THE BAUD RATE
GIVEN IS GREATER THAN THE MAXIMUM BAUD RATE FOR THE MODEM, NO
CHANGE IS MADE.
buffer COMMAND <"FILENAME">
tHE FOLLOWING COMMANDS ARE AVAILABLE WITH buffer:
clear - cLEARS ALL FILES FROM THE BUFFER.
close - cLOSES A CAPTURE FILE.
kill "FILENAME" - dELETES A FILE FROM THE BUFFER.
load "FILENAME" - lOADS A FILE FROM DISK INTO THE BUFFER.
open "FILENAME" - oPENS A CAPTURE FILE.
print "FILENAME" - sENDS A BUFFER FILE TO THE PRINTER.
save "FILENAME" - sAVES A FILE FROM THE BUFFER TO DISK.
send "FILENAME" - sENDS A FILE FROM THE BUFFER TO THE MODEM.
check [STRING NUMBER] "STRING"
wORKS IN CONJUNCTION WITH THE wait COMMAND TO DETECT INCOMING
STRINGS. fOR EXAMPLE,
check 2 "pASSWORD"
DEFINES STRING NUMBER 2 AS "pASSWORD". uP TO 6 STRINGS MAY BE
DEFINED. wHEN THE SCRIPT ENCOUNTERS A wait COMMAND, IT GOES TO
TERMINAL MODE AND WAIT UNTIL ONE OF THESE DEFINED STRINGS IS
RECEIVED, AND THEN IT RETURNS THE RECEIVED STRING NUMBER. tHE
check COMMAND DOES NOT WAIT.
dial "ENTRY NAME"
dIALS THE ENTRY WITH THE GIVEN NAME. tHE AUTODIALER KEEPS
REDIALING UNTIL EITHER A CARRIER IS FOUND OR THE REDIAL COUNT IS
EXHAUSTED (SEE redial).
dial# "PHONE NUMBER"
dIALS THE PHONE NUMBER SPECIFIED.
dialn [LOCATION IN PHONE LIST]
dIALS THE ENTRY IN THE PHONE LIST CORRESPONDING TO THE SPECIFIED
NUMBER. tHE NUMBERS DON'T SHOW UP ON THE AUTODIAL MENU, BUT, FOR
EXAMPLE, dialn 3 WOULD DIAL THE THIRD ENTRY FROM THE TOP.
disk [DEVICE NUMBER]
cHANGES THE DISK DEVICE DEFAULT TO THE SPECIFIED DEVICE NUMBER. iF
THE DEVICE IS NOT PRESENT, THE SCRIPT HALTS WITH AN ERROR.
diskc "DISK COMMAND"
sENDS THE SPECIFIED DISK COMMAND TO THE CURRENT DISK DEVICE. tHE
EXTRA DISK COMMANDS ADDED BY nOVATERM ARE ALSO VALID.
download "FILENAME,TYPE"
dOWNLOADS THE SPECIFIED FILE USING THE PROTOCOL IN MEMORY. tHE
ONE-LETTER TYPE SPECIFICATION IS OPTIONAL. iF USED, IT MUST BE
EITHER A "P", "S", OR "U" FOR PRG, SEQ, OR USR FILE TYPES,
RESPECTIVELY. fOR BATCH PROTOCOLS, THE FILE NAME SPECIFIED HERE IS
IGNORED.
drive [DRIVE NUMBER]
cHANGES THE DEFAULT DRIVE NUMBER (NOT DEVICE NUMBER).
end
tERMINATES THE SCRIPT PROGRAM.
font "FONT FILE"
lOADS A FONT FROM DISK.
font80 "FONT FILE"
lOADS AN 80 COLUMN FONT FROM DISK.
gettime
rEQUESTS THE USER TO INPUT THE CURRENT TIME. iF YOUR SCRIPT
PROGRAM USES THE until COMMAND TO WAIT FOR A CERTAIN TIME OF DAY,
YOU SHOULD INCLUDE THIS COMMAND AT THE START OF YOUR PROGRAM SO
THAT YOU MAY SET THE CLOCK.
go40
cHANGES TO 40 COLUMN MODE, IF THE TERMINAL EMULATOR ALLOWS IT.
go80
cHANGES TO 80 COLUMN MODE.
hangup
hANGS UP THE PHONE.
if <no> CONDITION then COMMAND
uSED TO TEST VARIOUS CONDITIONS. aNY ONE OF THE CONDITIONS BELOW
MAY BE SUBSTITUTED INTO THE COMMAND, AND IF THE CONDITION IS TRUE,
THE COMMAND AFTER then IS EXECUTED. aNY COMMAND MAY BE PUT AFTER
then.
carrier - cHECKS FOR A CARRIER. iF no IS IN FRONT OF IT, THE
COMMAND EXECUTES IN THE ABSENCE OF A CARRIER.
check [CHECK STRING] - cHECKS TO SEE IF THE SPECIFIED STRING NUMBER
WAS RECEIVED. tHERE MUST BE A NUMBER AFTER check, OR THE COMMAND
IS INVALID.
receive - cHECKS TO SEE IF DATA IS BEING RECEIVED. iF no PRECEDES
IT, THE COMMAND EXECUTES WHEN DATA IS NOT BEING RECEIVED.
ring - cHECKS TO SEE IF THE PHONE IS RINGING. iF no PRECEDES IT,
THE COMMAND EXECUTES WHEN THE PHONE ISN'T RINGING.
jump LABEL
jUMPS TO THE SPECIFIED LABEL IN THE PROGRAM. lABELS ARE
NON-COMMAND WORDS WHICH ARE PLACED BEFORE COMMANDS TO IDENTIFY A
LOCATION IN THE PROGRAM. fOR EXAMPLE:
LOOP check 1 "uSERNAME:"
.
.
jump LOOP
lABELS MAY CONTAIN ANY CHARACTERS OTHER THAN QUOTES, BUT A LABEL
MAY ONLY BE ONE WORD.
iF THE SCRIPT IS ENTERED IN THE FORM OF A PROGRAM FILE (RATHER THAN
A SEQUENTIAL FILE), AN ACTUAL LINE NUMBER MAY BE USED WITH THE jump
COMMAND. fOR EXAMPLE:
10 check 1 "uSERNAME:"
20 ...
30 ...
40 jump 10
...OR:
100 if no carrier then jump 100
link "SCRIPT PROGRAM"
lOADS AND EXECUTES A NEW SCRIPT PROGRAM.
macro [FUNCTION KEY NUMBER]
sENDS A FUNCTION KEY STRING. tHIS IS EQUIVALENT TO PRESSING ONE OF
THE 16 FUNCTION KEYS.
minit
iNITIALIZES THE MODEM IF NO CARRIER IS PRESENT.
modem "MODEM DRIVER"
lOADS A MODEM DRIVER.
offhook
tAKES THE PHONE OFF THE HOOK.
.opt PARAMETER
cHANGES A COMPILER OPTION. tHESE COMMANDS ARE NOT INCLUDED IN THE
PROGRAM WHEN IT IS COMPILED. iNSTEAD, THEY DIRECT THE COMPILER TO
TAKE CERTAIN ACTIONS OR SET FLAGS. tHE ONLY PARAMETERS CURRENTLY
SUPPORTED ARE:
.OPT ANSI : cONVERTS UPPERCASE CHARACTERS IN ALL FOLLOWING check
STRINGS TO UPPERCASE CHARACTERS WITH LOWER ascii
VALUES. tHIS COMMAND IS NECESSARY IF THE SCRIPT
IS GOING TO RUN IN ansi, vt52, OR vt102 MODE.
.OPT NOANSI : nO CONVERSION OF UPPERCASE CHARACTERS. tHIS IS THE
DEFAULT.
output "STRING"
oUTPUTS A STRING TO THE MODEM. cONTROL CHARACTERS ARE ENTERED AS
THEY ARE IN MACRO KEYS, WITH A ^ PRECEDING THE CORRESPONDING
LETTER. fOR EXAMPLE, A CARRIAGE RETURN (CONTROL-m) WOULD BE
ENTERED AS ^m.
pause [NUMBER OF SECONDS]
pAUSES THE PROGRAM FOR A SPECIFIED NUMBER OF SECONDS.
print "FILENAME"
sENDS A FILE FROM DISK TO THE PRINTER. iF THE PRINTER IS NOT
TURNED ON, THE SCRIPT ABORTS.
printer [DEVICE NUMBER]
cHANGES THE PRINTER DEVICE DEFAULT TO THE SPECIFIED DEVICE NUMBER.
iF THE DEVICE IS NOT PRESENT, THE SCRIPT ABORTS WITH AN ERROR.
prot "PROTOCOL"
lOADS A PROTOCOL.
redial [NUMBER OF TRIES]
sETS THE NUMBER OF TIMES TO REDIAL A NUMBER BEFORE QUITTING. iF A
NUMBER IS DIALED THIS MANY TIMES WITHOUT FINDING A CARRIER, THE
SCRIPT ABORTS.
screen "STRING"
pRINTS A TEXT MESSAGE ON THE SCREEN.
secaddr [SECONDARY ADDRESS]
cHANGES THE PRINTER SECONDARY ADDRESS.
send "FILENAME"
sENDS A FILE TO THE MODEM.
term "TERMINAL EMULATOR"
lOADS A TERMINAL EMULATOR.
uncheck [STRING NUMBER]
cLEARS THE STRING IN THE SPECIFIED STRING NUMBER. fOR EXAMPLE, IF
check 2 "pASSWORD" WAS PREVIOUSLY EXECUTED, uncheck 2 GETS RID OF
THAT DEFINITION FOR STRING NUMBER 2.
until "24-HOUR TIME"
pAUSES EXECUTION OF THE SCRIPT. tHE SCRIPT RESUMES WHEN THE TIME
OF DAY REACHES THE SPECIFIED TIME. tHE TIME MUST BE IN 24-HOUR
FORM, AS SHOWN:
until "hh:mm:ss"
fOR EXAMPLE:
until "22:35" WAITS UNTIL 10:35 pm
until "11:50:25" WAITS UNTIL 25 SECONDS PAST 11:50 am
upload "FILENAME"
uPLOADS A FILE USING THE PROTOCOL IN MEMORY.
wait
gOES INTO TERMINAL MODE AND RECEIVES DATA (AND PRINTS IT TO THE
SCREEN) WHILE WAITING FOR THE STRINGS SPECIFIED WITH THE check
COMMAND. wHEN ONE OF THE STRINGS IS FOUND, IT STOPS WAITING AND
CONTINUES WITH THE SCRIPT.
note: iF A RECEIVED STRING PATTERN MATCHES MORE THAN ONE STRING
SPECIFIED BY check COMMANDS, THE LOWEST NUMBER IS RETURNED. fOR
EXAMPLE, IF STRING 1 IS ">" AND STRING 2 IS "lOBBY>", AND THE
STRING "lOBBY>" IS RECEIVED, THE SCRIPT RECOGNIZES STRING 1 BECAUSE
IT IS A LOWER STRING NUMBER, EVEN THOUGH BOTH STRINGS MATCH THE
RECEIVED DATA.
3.3.3 aN EXAMPLE.
bELOW IS A SCRIPT PROGRAM FOR LOGGING INTO A cOLOR 64 bbs.
REDIAL 5 ; ABORT SCRIPT AFTER 5 UNSUCCESSFUL TRIES
DIAL"nAME OF bbs" ; AUTODIAL THE bbs
CHECK 1 "RETURN" ; SPECIFY TO CHECK FOR THE STRING "RETURN"
WAIT ; WAIT FOR STRING IN TERMINAL MODE
OUTPUT"^m" ; SEND A CARRIAGE RETURN
CHECK 1 "(Y/N)" ; CHECK FOR ascii/GRAPHICS PROMPT
WAIT
OUTPUT"Y" ; SEND A YES
CHECK 1 ">" ; WAIT FOR USER NUMBER PROMPT
MACRO 1 ; SEND PASSWORD MACRO - SHOULD CONTAIN USER
END ; NUMBER, ONE SECOND PAUSE, AND PASSWORD